package com.ruoyi.project.bas.basCustomer.service.impl;

import java.util.List;

import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.bas.basCustomer.mapper.BasCustomerMapper;
import com.ruoyi.project.bas.basCustomer.domain.BasCustomer;
import com.ruoyi.project.bas.basCustomer.service.IBasCustomerService;
import com.ruoyi.common.core.text.Convert;

/**
 * 客户信息Service业务层处理
 * 
 * @author qxq
 * @date 2023-05-31
 */
@Service
public class BasCustomerServiceImpl implements IBasCustomerService 
{
    @Autowired
    private BasCustomerMapper basCustomerMapper;

    /**
     * 查询客户信息
     * 
     * @param id 客户信息主键
     * @return 客户信息
     */
    @Override
    public BasCustomer selectBasCustomerById(String id)
    {
        return basCustomerMapper.selectBasCustomerById(id);
    }

    /**
     * 查询客户信息列表
     * 
     * @param basCustomer 客户信息
     * @return 客户信息
     */
    @Override
    public List<BasCustomer> selectBasCustomerList(BasCustomer basCustomer)
    {
        return basCustomerMapper.selectBasCustomerList(basCustomer);
    }

    /**
     * 新增客户信息
     * 
     * @param basCustomer 客户信息
     * @return 结果
     */
    @Override
    public int insertBasCustomer(BasCustomer basCustomer)
    {
        basCustomer.setId(IdUtils.simpleUUID());
        return basCustomerMapper.insertBasCustomer(basCustomer);
    }

    /**
     * 修改客户信息
     * 
     * @param basCustomer 客户信息
     * @return 结果
     */
    @Override
    public int updateBasCustomer(BasCustomer basCustomer)
    {
        return basCustomerMapper.updateBasCustomer(basCustomer);
    }

    /**
     * 批量删除客户信息
     * 
     * @param ids 需要删除的客户信息主键
     * @return 结果
     */
    @Override
    public int deleteBasCustomerByIds(String ids)
    {
        return basCustomerMapper.deleteBasCustomerByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除客户信息信息
     * 
     * @param id 客户信息主键
     * @return 结果
     */
    @Override
    public int deleteBasCustomerById(String id)
    {
        return basCustomerMapper.deleteBasCustomerById(id);
    }
}
